<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <!-- 标题 -->
    <title>掌柜</title>
    <!-- 关键词 -->
    <meta name="keywords" content="" />
    <!-- 网站简介 -->
    <meta name="description" content="" />
    <!-- 自适应屏幕 -->
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
    <!-- IE兼容 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 最新 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="css/bootstrap.css">
    <!-- 手机滚动 css 文件 -->
    <link href="css/mobiscroll.core-2.5.2.css" rel="stylesheet" type="text/css" />
    <!-- 核心 CSS 文件 -->
    <link rel="stylesheet" href="css/style.css" type="text/css">
    <!-- jQuery文件 -->
    <script src="js/jquery.min.js"></script>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="js/bootstrap.min.js"></script>
    <script src="js/mobiscroll.core-2.5.2.js"></script>
    <script src="js/mobiscroll.select-2.5.1.js"></script>
    <!-- 输入框信息检查判断 js-->
    <script src="js/input-rule.js"></script>
</head>
<body>
    <!-- Start add-goods -->
    <div class="add-goods">
        <!-- 固定顶部 -->
        <div class="add-goods-top clearfix">
            <div class="left">
                <a href="sort-manage.html">取消</a>
            </div>
            <div class="add-goodsing">
                添加分类
            </div>
            <div class="right">
                <input type="button" value="保存" id="st1">
            </div>
        </div>
        <div class="add-goods-edit add-sort">
            <div class="goods-numb clearfix">
                <div class="left">菜品分类</div>
                <div class="right">
                    <input type="text" id="goodssort" >
                </div>
            </div>
     
            <div class="goods-numb clearfix" style="border-bottom: 1px solid #999f60;">
                <div class="left">分类折扣</div>
                <div class="right">
                    <input type="text" id="sortdiscount">
                </div>
            </div>
        </div>
        <div class="sort-tip">
            <p>说明：分类折扣100为无折扣。</p>
            <p>例如：输入85为85折。</p>
        </div>
    </div>
    <!-- End add-goods -->

    <script>
        window.onload = function cal(){
            $("#st1").css("color","#999");
            $("#st1").attr({"disabled":true});
        }
        $('#goodssort').on("keyup blur", function() { //验证标题
            var goodssort=document.getElementById("goodssort");
            var _this = $(this);
            _this.inputCheck({
                callback : function(result){
                    if(result.nbsp || result.length < 0.5){
                        $("#st1").css("color","#999"); 
                        $("#st1").attr({"disabled":true});
                    }
                    else{
                        $("#st1").css("color","#fff");
                        $("#st1").attr({"disabled":false});
                    }
                }
            });
        });
        $('#sortdiscount').on("keyup blur", function() { //验证标题
            var sortdiscount=document.getElementById("sortdiscount");
            var _this = $(this);
            _this.inputCheck({
                callback : function(result){
                    if(result.nbsp|| result.length < 0.5 || !result.zhengshu||result.length > 1.5){
                        $("#st1").css("color","#999"); 
                        $("#st1").attr({"disabled":true});
                    }
                    else{
                        $("#st1").css("color","#fff");
                        $("#st1").attr({"disabled":false});
                    }
                }
            });

        });

    </script>
</body>
</html>